<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../layui/css/layui.css" media="all" />
</head>
<style>
    ::-webkit-scrollbar {display:none}/*隐藏横向滚动条但可以滚动*/
    input[type="text"]{width: 300px;}
    .div{width: 500px;height: 450px;margin-left: 30px;}
</style>
<body>
<div class="div">
    <form class="layui-form">
        <div class="layui-form-item">
            <label class="layui-form-label">公司名称:</label>
            <div class="layui-input-block">
                <input type="hidden" name="jobid" th:value="${job.jobid}">
                <input type="text" th:value="${job.companyname}" name="companyname" required  lay-verify="required" placeholder="请输入公司名称" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">入职时间: </label>
            <div class="layui-input-block">
                <input type="text" th:value="${job.startdate}" id="hireDay" name="startdate" required  lay-verify="required" placeholder="请输入入职时间" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">离职时间:</label>
            <div class="layui-input-block">
                <input type="text" th:value="${job.enddate}" id="fireDay" name="enddate" required  lay-verify="required" placeholder="请输入离职时间" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">岗    位   : </label>
            <div class="layui-input-block">
                <input type="text" th:value="${job.degree}" name="degree" required  lay-verify="required" placeholder="请输入岗位 " autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">离职原因: </label>
            <div class="layui-input-block">
                <input type="text" th:value="${job.reason}" name="reason" required  lay-verify="required" placeholder="请输入离职原因" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item layui-form-text"  style="width: 420px;">
            <label class="layui-form-label"><i class="layui-icon">&#xe702;</i> 说    明   : </label>
            <div class="layui-input-block">
                <textarea name="remark" th:text="${job.remark}" placeholder="请输入内容" class="layui-textarea"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter="formDemo"><i class="layui-icon">&#xe609;</i>保存</button>
                <button type="reset" class="layui-btn layui-btn-radius layui-btn-primary "><i class="layui-icon">&#xe669;</i> 重置</button>
            </div>
        </div>
    </form>
</div>
</body>
<script src="../js/jquery/jquery-3.1.0.min.js"></script>
<script src="../layui/layui.js"></script>
<script>
    layui.use(['form','element','upload','laydate'], function(){
        var $ = layui.jquery
            ,element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
        var form=layui.form;
        var laydate=layui.laydate;


        laydate.render({
            elem: '#hireDay'
        });
        laydate.render({
            elem: '#fireDay'
        });

        //监听提交
        //你可以在这里做操作  也可以不使用这个方法
        form.on('submit(formDemo)', function(data){
            $.ajax({
                url: '/option/workedit',
                type: 'post',
                data:data.field,
                dataType: 'json',
                success:function(data){
                    if(data){
                        //先得到当前iframe层的索引
                        var index = parent.layer.getFrameIndex(window.name);
                        //再执行关闭
                        parent.layer.close(index);
                        layer.msg(JSON.stringify("修改成功"));
                        window.parent.location.reload();
                    }else {
                        layer.msg('修改失败', { icon: 5, time: 2000 });
                    }
                },
            })
            return false;
        });

    });
</script>
</html>